<template>
   <div>

     子组件的input: <el-input v-model="inputValue"  placeholder="子组件的值" @blur="sendValue"></el-input>
   </div>
</template>

<script>
export default {
  name: "comTest",
  props:{
    value:{
      type:Number|String,
      default:0
    }
  },
  watch:{
    value:{
      handler(newV,oldV){
        this.inputValue = newV
      },
      immediate:true,
      deep:true
    }
  },
  data(){
    return{
      inputValue:''
    }
  },
  methods:{
    sendValue(){
      this.$emit("update:value",this.inputValue)
      this.$emit("update:changeValue",this.inputValue)
    }
  }
}
</script>

<style scoped>

</style>